#!/bin/sh

. /opt/truecl/etc/clenv.sh

if [ ! -d /opt/truecl/clbackups ]
then
	mkdir -p /opt/truecl/clbackups
fi

backup_file="/opt/truecl/clbackups/clconfig_`date +%Y-%m-%d`.tar"
clreq config_backup FILE $backup_file OVERWRITE 1 >/dev/null 2>/dev/null
if [ $? = 0 ]
then
	compress -f $backup_file
fi
exit $?
